import 'dart:io';

class CMSCheckin {
  int accountId;
  String accountName;
  String carrier;
  String containerNo;
  String containerType;
  String createdBy;
  int createdById;
  String createdDatetime;
  String forecastSendDate;
  int id;
  bool isPackage;
  String status;
  String unloadedDatetime;
  String updatedBy;
  int updatedById;
  String updatedDatetime;
  String warehouseCode;
  String unloadFlag;

  CMSCheckin({
    this.accountId,
    this.accountName,
    this.carrier,
    this.containerNo,
    this.containerType,
    this.createdBy,
    this.createdById,
    this.createdDatetime,
    this.forecastSendDate,
    this.id,
    this.isPackage,
    this.status,
    this.unloadedDatetime,
    this.updatedBy,
    this.updatedById,
    this.updatedDatetime,
    this.warehouseCode,
    this.unloadFlag,
  });

  factory CMSCheckin.fromJson(Map<String, dynamic> json) {
    return CMSCheckin(
      accountId: json["accountId"],
      accountName: json["accountName"],
      carrier: json["carrier"],
      containerNo: json["containerNo"],
      containerType: json["containerType"],
      createdBy: json["createdBy"],
      createdById: json["createdById"],
      createdDatetime: json["createdDatetime"],
      forecastSendDate: json["forecastSendDate"],
      id: json["id"],
      isPackage: json["isPackage"],
      status: json["status"],
      unloadedDatetime: json["unloadedDatetime"],
      updatedBy: json["updatedBy"],
      updatedById: json["updatedById"],
      updatedDatetime: json["updatedDatetime"],
      warehouseCode: json["warehouseCode"],
      unloadFlag: json["unloadFlag"],
    );
  }
}

class CMSCheckinEmpty {
  String containerNo;
  String unloadDate;

  Map<String, dynamic> toJson() {
    return {
      "containerNo": this.containerNo,
      "unloadDate": this.unloadDate,
    };
  }
}

class UnloadQr {
  String containerNo; //柜号
  String deliveryDate; //预计
  String palletQty; //托盘数

  String doPho;
  String door;
  String seal;
  String goods;

  UnloadQr({
    this.containerNo,
    this.deliveryDate,
    this.palletQty,
    this.doPho,
    this.door,
    this.seal,
    this.goods,
  });

  factory UnloadQr.fromJson(Map<String, dynamic> json) {
    return UnloadQr(
      containerNo: json["containerNo"],
      deliveryDate: json["deliveryDate"],
      palletQty: json["palletQty"],
      doPho: json["doPho"],
      door: json["door"],
      seal: json["seal"],
      goods: json["goods"],
    );
  }
}

class CMSTally {
  String containerNo;
  int id;
  bool isConfirm;
  int packageNum;

  CMSTally({
    this.containerNo,
    this.id,
    this.isConfirm,
    this.packageNum,
  });

  factory CMSTally.fromJson(Map<String, dynamic> json) {
    return CMSTally(
      containerNo: json["containerNo"],
      id: json["id"],
      isConfirm: json["isConfirm"],
      packageNum: json["packageNum"],
    );
  }
}

class CMSTallyedDetail {
  int total;
  List<CMSTallyDetail> tallyedList;

  CMSTallyedDetail({
    this.total,
    this.tallyedList,
  });

  factory CMSTallyedDetail.fromJson(Map<String, dynamic> json) {
    return CMSTallyedDetail(
      total: json["total"],
      tallyedList: json['tallyedList'] == null ? null : (new List<dynamic>.from(json['tallyedList']).map((userJson) => CMSTallyDetail.fromJson(userJson)).toList()),
    );
  }
//

}

class CMSTallyDetail {
  String destination;
  int id;
  int num;
  int totalCtns; //箱数
  double totalVolume; //"总体积（m³）"
  List<CMSTallyDetailLpn> inTallys;
  bool click; //点击展开

  CMSTallyDetail({
    this.destination,
    this.id,
    this.num,
    this.totalCtns,
    this.totalVolume,
    this.inTallys,
    this.click,
  });

  factory CMSTallyDetail.fromJson(Map<String, dynamic> json) {
    return CMSTallyDetail(
      destination: json["destination"],
      id: json["id"],
      num: json["num"],
      totalCtns: json["totalCtns"],
      totalVolume: json["totalVolume"],
      inTallys: json['inTallys'] == null ? null : (new List<dynamic>.from(json['inTallys']).map((userJson) => CMSTallyDetailLpn.fromJson(userJson)).toList()),
      click: json["click"],
    );
  }
}

class CMSTallyDetailLpn {
  String palletLpn;
  int id;
  int num = 1;
  bool delete;

  CMSTallyDetailLpn({
    this.palletLpn,
    this.id,
    this.num,
    this.delete,
  });

  factory CMSTallyDetailLpn.fromJson(Map<String, dynamic> json) {
    return CMSTallyDetailLpn(
      palletLpn: json["palletLpn"],
      id: json["id"],
      num: json["num"],
      delete: json["delete"],
    );
  }
}

class CMSTallySubmitQr {
  int transNotifyId;
  String containerNo;
  String palletLpn;

  Map<String, dynamic> toJson() {
    return {
      "transNotifyId": this.transNotifyId,
      "containerNo": this.containerNo,
      "palletLpn": this.palletLpn,
    };
  }
}

class CMSOBLPN {
  int id;
  String deliveryDate;
  String destination;
  String bolNumber;
  int pendedQty;
  int pendingQty;
  int qty;
  bool click;

  CMSOBLPN({
    this.id,
    this.deliveryDate,
    this.destination,
    this.bolNumber,
    this.pendedQty,
    this.pendingQty,
    this.qty,
    this.click,
  });

  factory CMSOBLPN.fromJson(Map<String, dynamic> json) {
    return CMSOBLPN(
      id: json["id"],
      deliveryDate: json["deliveryDate"],
      destination: json["destination"],
      bolNumber: json["bolNumber"],
      pendedQty: json["pendedQty"],
      pendingQty: json["pendingQty"],
      qty: json["qty"],
      click: json["click"],
    );
  }
}

class CMSOBLPNDetails {
  int id;
  int isPick; //0未扫描 1已扫描
  String location;
  String palletLpn;

  CMSOBLPNDetails({
    this.id,
    this.isPick,
    this.location,
    this.palletLpn,
  });

  factory CMSOBLPNDetails.fromJson(Map<String, dynamic> json) {
    return CMSOBLPNDetails(
      id: json["id"],
      isPick: json["isPick"],
      location: json["location"],
      palletLpn: json["palletLpn"],
    );
  }
}

class CMSOBLPNComplete {
  int id;

  Map<String, dynamic> toJson() {
    return {
      "id": this.id,
    };
  }
}

class CMSOBLPNDetailsBase {
  int bookingId;
  String trailer;
  String bol;
  List<CMSOBLPNDetails> lpnList;

  CMSOBLPNDetailsBase({
    this.bookingId,
    this.trailer,
    this.bol,
    this.lpnList,
  });

  factory CMSOBLPNDetailsBase.fromJson(Map<String, dynamic> json) {
    return CMSOBLPNDetailsBase(
      bookingId: json["bookingId"],
      trailer: json["trailer"],
      bol: json["bol"],
      lpnList: json['lpnList'] == null ? null : (new List<dynamic>.from(json['lpnList']).map((userJson) => CMSOBLPNDetails.fromJson(userJson)).toList()),
    );
  }
}

class CMSOBLPNTrailerQr {
  int orderId;
  String trailer;
  String palletLpn;

  Map<String, dynamic> toJson() {
    return {
      "orderId": this.orderId,
      "trailer": this.trailer,
      "palletLpn": this.palletLpn,
    };
  }
}

class CMSOBLPNSubmitQr {
  int orderId;
  String trailer;
  String bol;
  String seal;
  String goods;

  Map<String, dynamic> toJson() {
    return {
      "orderId": this.orderId,
      "trailer": this.trailer,
      "bol": this.bol,
      "seal": this.seal,
      "goods": this.goods,
    };
  }
}

class ContainerTally {
  int id;
  String containerNo;
  String forecastSendDate; //预计到仓日期
  int qty;
  int pendingQty;
  int putawayQty;
  bool isShow;
  List<ContainerTallyDetail> data = new List();

  ContainerTally({
    this.id,
    this.containerNo,
    this.forecastSendDate,
    this.qty,
    this.pendingQty,
    this.putawayQty,
    this.isShow,
    this.data,
  });

  factory ContainerTally.fromJson(Map<String, dynamic> json) {
    return ContainerTally(
      id: json["id"],
      containerNo: json["containerNo"],
      forecastSendDate: json["forecastSendDate"],
      qty: json["qty"],
      pendingQty: json["pendingQty"],
      putawayQty: json["putawayQty"],
      isShow: json["isShow"],
      data: json['data'] == null ? null : (new List<dynamic>.from(json['data']).map((userJson) => ContainerTallyDetail.fromJson(userJson)).toList()),
    );
  }

}

class ContainerTallyDetail {
  int id; //id
  String palletLpn; //sku
  String wholeCode;

  ContainerTallyDetail({
    this.id,
    this.palletLpn,
    this.wholeCode,
  });

  factory ContainerTallyDetail.fromJson(Map<String, dynamic> json) {
    return ContainerTallyDetail(
      id: json["id"],
      palletLpn: json["palletLpn"],
      wholeCode: json["wholeCode"],
    );
  }

}

class CMSPutatayLpn{
  String palletLpn;//sku
  String containerNo;

  CMSPutatayLpn({
    this.palletLpn,
    this.containerNo,
  });

  factory CMSPutatayLpn.fromJson(Map<String, dynamic> json) {
    return CMSPutatayLpn(
      palletLpn: json["palletLpn"],
      containerNo: json["containerNo"],
    );
  }

}

class ContainerPutatayQr{
  String location;
  String palletLpn;

  Map<String, dynamic> toJson() {
    return {
      "location": this.location,
      "palletLpn": this.palletLpn,
    };
  }
}
